package ae.pcfc.cldos.online.common.clddb.domain.manager.provider;

import java.util.List;

import ae.pcfc.cldos.online.common.clddb.dao.MessageInboxDAO;
import ae.pcfc.cldos.online.common.clddb.domain.MessageInbox;
import ae.pcfc.cldos.online.common.clddb.domain.manager.MessageInboxDOM;
import ae.pcfc.cldos.online.common.vo.UserInformationVO;
import ae.pcfc.cldos.online.common.vo.notifications.NotificationsDbRestrictionsVO;
import ae.pcfc.cldos.online.common.vo.tasks.TaskRequestDbRestrictions;

/**
 * 
 * @author arosa
 *
 */
public class MessageInboxDOMImpl implements MessageInboxDOM {

	private MessageInboxDAO messageInboxDAO;
	
	public void setMessageInboxDAO(MessageInboxDAO messageInboxDAO) {
		this.messageInboxDAO = messageInboxDAO;
	}

	public void add(MessageInbox messageInbox) {
		messageInboxDAO.add(messageInbox);
	}
	
	public List<MessageInbox> getUserNotifications(UserInformationVO userInformationVO, 
			NotificationsDbRestrictionsVO notificationsDbRestrictionsVO){
		return messageInboxDAO.getUserNotifications(userInformationVO, notificationsDbRestrictionsVO);
	}
	
	public List<MessageInbox> getUserTasks(UserInformationVO userInformationVO, TaskRequestDbRestrictions taskRequestDbRestrictions){
		return messageInboxDAO.getUserTasks(userInformationVO, taskRequestDbRestrictions);
	}
	
	public List<MessageInbox> getUncomplitedTaskByAppId(Long appId){
		return messageInboxDAO.getUncomplitedTaskByAppId(appId);
	}
	
	public void update(MessageInbox messageInbox){
		messageInboxDAO.update(messageInbox);
	}

	public void completeAllApplicationTasks(Long appId) {
		messageInboxDAO.completeAllApplicationTasks(appId);
	}
	
	public Integer getTasksCount(UserInformationVO userInformationVO, TaskRequestDbRestrictions taskRequestDbRestrictions){
		return messageInboxDAO.getTasksCount(userInformationVO, taskRequestDbRestrictions);
	}
	
	public Integer getTotalNotifications(UserInformationVO userInformationVO, 
			NotificationsDbRestrictionsVO notificationsDbRestrictionsVO){
		return messageInboxDAO.getTotalNotifications(userInformationVO, notificationsDbRestrictionsVO);
	}
	/* (non-Javadoc)
	 * @see ae.pcfc.cldos.online.common.clddb.domain.manager.MessageInboxDOM#getNotificationDetail(java.lang.Long)
	 */
	public MessageInbox getNotificationDetail(Long msgId){
		return messageInboxDAO.getNotificationDetail(msgId);
	}
	
	public Integer getNewNotificationsCount(UserInformationVO userInformationVO){
		return messageInboxDAO.getNewNotificationsCount(userInformationVO);
	}
	
	public Integer getNewTaskCount(UserInformationVO userInformationVO){
		return messageInboxDAO.getNewTaskCount(userInformationVO);
	}
	
	public void markNotificationAsReaded(Long mesId, UserInformationVO userInformationVO){
		messageInboxDAO.markNotificationAsReaded(mesId, userInformationVO);
	}
	
}
